<div class="panel panel-default panel-full" ng-controller="schtotalCtrl">
    <!-- Default panel contents -->
    <div class="panel-heading">统计数据</div>
    <div class="panel-body">
        <div class="row">

            <div class="col-lg-3">
                <p class="input-group">
                    <span class="input-group-addon"><label>开始时间</label></span>

                    <input class="form-control" date-time format="YYYY-MM-DD HH:mm:ss" view="date" maxView="year" minView="minutes" ng-model="startdate" readonly>
                    <!--<input date-time name="pickerBothDates" ng-model="startdate" id="pickerBothDates"  view="date" min-view="hours" timezone="CTS" format="YYYY-MM-DD HH:mm:ss">-->



                </p>
            </div>

            <div class="col-lg-3">
                <p class="input-group">
                    <span class="input-group-addon"><label>截止时间</label></span>

                    <input  class="form-control"  date-time format="YYYY-MM-DD HH:mm:ss"  view="date" maxView="year" minView="minutes"  ng-model="enddate" readonly>


                </p>
            </div>
            <div class="col-lg-2">
                <p class="input-group">
                    <span class="input-group-addon"><label>分页条数</label></span>
                    <select ng-model="pageCount" class="form-control ">
                        <option value="10">10</option>
                        <option value="20">20</option>
                        <option value="40">40</option>
                        <option value="80">80</option>
                        <option value="160">160</option>
                        <option value="320">320</option>
                        <option value="512">512</option>
                    </select>

                </p>
            </div>
            <div class="col-lg-3">
                <button class="btn btn-success" type="button" ng-click="sch()">
                    查询
                </button>
            </div>

        </div>

        <div class="row">
            <div class="col-lg-12">

                <ul class="nav nav-tabs">
                    <li role="presentation" class="{{!!!m?'active':''}}" ng-click="m=0"><a
                            href="javascript:void(0)">数据</a></li>
                    <li role="presentation" class="{{m==1?'active':''}}" ng-click="m=1"><a
                            href="javascript:void(0)">数据流量图</a></li>
                    <li role="presentation" class="{{m==2?'active':''}}" ng-click="m=2"><a
                            href="javascript:void(0)">在线会话图</a></li>
                    <li role="presentation" class="{{m==3?'active':''}}" ng-click="m=3"><a
                            href="javascript:void(0)">报文数量图</a></li>
                </ul>
            </div>

        </div>
        <div class="row">
            <div class="col-lg-12 " >


                <div  style="height:400px;overflow: auto;padding:0px 15px 15px 15px;border-left:1px solid #ddd;border-right:1px solid #ddd;border-bottom:1px solid #ddd">

                    <table ng-if="!!!m" class="table table-bordered table-responsive table-hover table-condensed" style="margin-top:20px;">
                        <thead>
                        <tr>
                            <th rowspan="2" nowrap="nowrap">序号</th>
                            <th rowspan="2" nowrap="nowrap">时间</th>
                            <th colspan="2" nowrap="nowrap">总流量(字节)</th>
                            <th colspan="2" nowrap="nowrap">实时流量(字节/秒)</th>
                            <th colspan="2" nowrap="nowrap">报文总数(个)</th>
                            <th colspan="2" nowrap="nowrap">实时报文(个/秒)</th>

                            <th rowspan="2" nowrap="nowrap">发布主题(个)</th>

                            <th colspan="2" nowrap="nowrap">发布消息(个)</th>
                            <th colspan="2" nowrap="nowrap">发布返回(个)</th>
                            <th colspan="2" nowrap="nowrap">发布收到(个)</th>
                            <th colspan="2" nowrap="nowrap">发布释放(个)</th>
                            <th colspan="2" nowrap="nowrap">发布完成(个)</th>

                            <th colspan="2" nowrap="nowrap">订阅主题(个)</th>
                            <th colspan="2" nowrap="nowrap">取消订阅(个)</th>
                            <th colspan="2" nowrap="nowrap">心跳(个)</th>
                            <th colspan="3" nowrap="nowrap">会话(个)</th>
                        </tr>
                        <tr>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>
                            <th nowrap="nowrap">发送</th>
                            <th nowrap="nowrap">接收</th>

                            <th nowrap="nowrap">发送</th>

                            <th nowrap="nowrap">收到</th>
                            <th nowrap="nowrap">返回</th>
                            <th nowrap="nowrap">收到</th>
                            <th nowrap="nowrap">返回</th>
                            <th nowrap="nowrap">请求</th>
                            <th nowrap="nowrap">响应</th>
                            <th nowrap="nowrap">断开</th>
                            <th nowrap="nowrap">在线</th>
                            <th nowrap="nowrap">累计</th>
                        </tr>
                        </thead>

                        <tbody>
                        <tr ng-repeat="ctotal in data track by $index">

                            <td>{{$index+1+pageCount*(currentPage-1)}}</td>
                            <td>{{ctotal.CurTime| date:'yyyy-MM-dd HH:mm:ss.sss'}}</td>
                            <td>{{ctotal.ReveiveDataSize | fomatDataSize}}</td>
                            <td>{{ctotal.SendDataSize | fomatDataSize}}</td>
                            <td>{{ctotal.CurReceiveDataFlow |fomatflow}}</td>
                            <td>{{ctotal.CurSendDataFlow |fomatflow}}</td>
                            <td>{{ctotal.ReceiveTotalNum}}</td>
                            <td>{{ctotal.SendTotalNum}}</td>
                            <td>{{ctotal.CurReceivePacketNum}}</td>
                            <td>{{ctotal.CurSendPacketNum}}</td>
                            <td>{{ctotal.SendPubNum}}</td>
                            <td>{{ctotal.ReceivePublishNum}}</td>
                            <td>{{ctotal.SendPublishNum}}</td>
                            <td>{{ctotal.ReceivePubackNum}}</td>
                            <td>{{ctotal.SendPubackNum}}</td>
                            <td>{{ctotal.ReceivePubrecNum}}</td>
                            <td>{{ctotal.SendPubrecNum}}</td>
                            <td>{{ctotal.ReceivePubrelNum}}</td>
                            <td>{{ctotal.SendPubrelNum}}</td>
                            <td>{{ctotal.ReceivePubcompNum}}</td>
                            <td>{{ctotal.SendPubcompNum}}</td>
                            <td>{{ctotal.ReceiveSubscribeNum}}</td>
                            <td>{{ctotal.SendSubackNum}}</td>
                            <td>{{ctotal.ReceiveUnsubscribeNum}}</td>
                            <td>{{ctotal.SendUnsubackNum}}</td>
                            <td>{{ctotal.ReceivePingreqNum}}</td>
                            <td>{{ctotal.SendPingrespNum}}</td>
                            <td>{{ctotal.CloseNum}}</td>
                            <td>{{ctotal.OnlineNum}}</td>
                            <td>{{ctotal.ConnectNum}}</td>
                        </tr>
                        </tbody>
                    </table>

                    <div echart="echarts,echarts/chart/line" option="ecoption_flow" ng-if="m==1"
                         theme="macarons"  style="height:400px;width:100%"></div>

                    <div echart="echarts,echarts/chart/line" option="ecoption_session" ng-if="m==2"
                         theme="macarons"  style="height:400px;width:100%"></div>
                    <div echart="echarts,echarts/chart/line" option="ecoption_packets" ng-if="m==3"
                         theme="macarons"  style="height:400px;width:100%"></div>
                </div>

            </div>

        </div>
    </div>

    <div class="panel-footer">

        <uib-pagination
                total-items="totalPage"
                ng-model="currentPage"
                max-size="maxSize"
                class="pagination-sm"
                boundary-links="true"
                previous-text="上页"
                next-text="下页"
                first-text="首页"
                last-text="尾页"
                rotate="false"
                ng-change="pageChanged()"
                num-pages="numPages"></uib-pagination>
    </div>
</div>